//
//  ZMOcHelper.h
//  TravelForDriver
//
//  Created by Rowling on 2020/9/11.
//  Copyright © 2020 智蚂优服. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, GradientType) {
    GradientFromTopToBottom = 1,            //从上到下
    GradientFromLeftToRight,                //从左到右
    GradientFromLeftTopToRightBottom,       //从左上到右下
    GradientFromLeftBottomToRightTop        //从左下到右上
};

@interface ZMOcHelper : NSObject

/**
 *  根据给定的颜色，生成渐变色的图片
 *  @param imageSize        要生成的图片的大小
 *  @param colorArr         渐变颜色的数组
 *  @param percents          渐变颜色的占比数组
 *  @param gradientType     渐变色的类型
 */
+ (UIImage *)createImageWithSize:(CGSize)imageSize gradientColors:(NSArray *)colorArr percentage:(NSArray *)percents gradientType:(GradientType)gradientType;

+ (void)imageWihtSize:(UIImage *)image size:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion;

+(BOOL)isNull:(id)value;

+ (NSMutableArray *)groupAction2:(NSMutableArray *)arr;

#pragma -mark:通过一个View将其内容生成图片
+(UIImage *)imageWithCaputureView:(UIView *)view;

//视频压缩
+(void)VideoTranstoMP4:(NSURL *)Url;

//获取网络视频第一帧
+ (UIImage *)getScreenShotImageFromVideoURL:(NSString *)fileurl;
//加密
+(NSString *) encryptUseDES:(NSString *)plainText key:(NSString *)key;
//解密
+(NSString *) decryptUseDES:(NSString *)plainText key:(NSString *)key;

+ (NSString*)encrypt:(NSString*)plainText key:(NSString *)key;

+ (NSString*)decrypt:(NSString*)encryptText key:(NSString *)key;
@end

NS_ASSUME_NONNULL_END
